#include <fstream>
#include <utility>
#include "big_int.h"


int main()
{
   std::ifstream in("in.txt");
   std::ofstream out("out.txt");
   
   const big_int ZERO(0);

   big_int dividend, divider;
      while (in >> dividend >> divider)
   
   {
      if (divider == ZERO)
      {
         out << "<error>\n\n\n";
         continue;
      }
      std::pair<big_int, big_int> answer = dividend.divide_with_remainer(divider);
      out << answer.first << "\n" << answer.second << "\n\n";
   }
   return 0; 
   
}
